package top.hmtools.beans;

import top.hmtools.enums.EDBType;

/**
 * 数据库连接信息
 * @author HyboJ
 *
 */
public class DBConnectInfoBean {

	/**
	 * 主键
	 */
	private String id;
	
	/**
	 * 名称
	 */
	private String name;
	
	/**
	 * 所属数据库的类型
	 * <br>1：MySQL，2：Oracle，3：SqlServer，4：SQLite
	 * <br>使用top.hmtools.enums.EDBType
	 */
	private int db_type;
	
	/**
	 * 数据库链接URL
	 */
	private String url;
	
	/**
	 * 数据库连接用户名
	 */
	private String username;
	
	/**
	 * 数据库连接密码
	 */
	private String password;
	
	/**
	 * 描述,注释,说明
	 */
	private String comment;
	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the db_type
	 */
	public int getDb_type() {
		return db_type;
	}
	/**
	 * @param db_type the db_type to set
	 */
	public void setDb_type(int db_type) {
		this.db_type = db_type;
	}
	
	public void setDb_type(String db_type){
		this.db_type = EDBType.getTypeCodeByName(db_type);
	}
	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}
	/**
	 * @param url the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}
	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}
	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}
	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}
	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}
	/**
	 * @return the comment
	 */
	public String getComment() {
		return comment;
	}
	/**
	 * @param comment the comment to set
	 */
	public void setComment(String comment) {
		this.comment = comment;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "DBConnectInfoBean [id=" + id + ", name=" + name + ", db_type=" + db_type + ", url=" + url
				+ ", username=" + username + ", password=" + password + ", comment=" + comment + "]";
	}
	
	
}
